#ifndef SLE_CLIENT_H
#define SLE_CLIENT_H

#include "sle_ssap_client.h"

/**
 * @brief Set the name of the SLE server.
 *
 * This function sets the name of the SLE server to which the client will connect.
 *
 * @param name The name of the server
 * @author Maker Studio
 * @license Apache 2.0 
 */
void sle_set_server_name(char *name);

/**
 * @brief Initialize the SLE client.
 *
 * This function initializes the SLE client, setting up necessary resources and configurations.
 *
 * @return None
 * @author Maker Studio
 * @license Apache 2.0 
 */
void sle_client_init(void);

/**
 * @brief Start scanning for the SLE service.
 *
 * This function initiates a scan to discover the SLE service provided by the server.
 *
 * @return None
 * @author Maker Studio
 * @license Apache 2.0 
 */
void sle_start_scan(void);

/**
 * @brief Wait until connected to the SLE service.
 *
 * This function blocks until a connection to the SLE service has been established.
 *
 * @return None
 * @author Maker Studio
 * @license Apache 2.0 
 */
void sle_wait_connected(void);

/**
 * @brief Send data to the SLE server.
 *
 * This function sends a block of data to the SLE server over the established connection.
 *
 * @param data Pointer to the data buffer
 * @param length Length of the data buffer in bytes
 * @return Returns 0 on success, or an error code on failure
 * @author Maker Studio
 * @license Apache 2.0 
 */
int sle_client_send_data(uint8_t *data, uint8_t length);

/**
 * @brief Check if the SLE client is connected.
 *
 * This function checks whether the SLE client is currently connected to the server.
 *
 * @return Returns non-zero if connected, zero otherwise
 * @author Maker Studio
 * @license Apache 2.0 
 */
uint8_t sle_is_connected(void);

/**
 * @brief Get the connection ID.
 *
 * This function retrieves the unique identifier for the current connection.
 *
 * @return Connection ID as a 16-bit unsigned integer
 * @author Maker Studio
 * @license Apache 2.0 
 */
uint16_t sle_get_conn_id(void);

/**
 * @brief Get parameters for sending data.
 *
 * This function returns a pointer to the structure containing parameters needed for sending data.
 *
 * @return Pointer to ssapc_write_param_t structure
 * @author Maker Studio
 * @license Apache 2.0 
 */
ssapc_write_param_t *sle_get_send_param(void);

#endif // SLE_CLIENT_H